<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh">
<head>        
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
    <!--[if gt IE 8]>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />        
    <![endif]-->        
    
    <title>报名系统</title>
    <%@include file="res.jsp" %>
    
</head>
<body>    
 
 	<jsp:include page="header.jsp"></jsp:include>

    <jsp:include page="menu.jsp"></jsp:include>
    
	<jsp:include page="com_bbs.jsp"></jsp:include>
    
    <div class="content">

        <div class="row-fluid">
            <div class="span12">
                <div class="widget">
                    <div class="wrapper"> 
	                    <form action="page/article_manager.action" method="post" id="validate">
	                        <div class="input-append input-prepend">
	                        	<input type="hidden" name="singupId" value="${singupId }"/>
	                            <span class="add-on"><span class="icon-search"></span></span>                            
	                            <input type="text" name="keyword" value="${keyword }" class="validate[required,maxSize[50]]" placeholder="搜索..." style="width: 838px;">
	                            <button type="submit" class="btn btn-primary">搜索</button> 
	                        </div>    
	                    </form>      
                    </div>
                </div>
              
                <div class="widget">
                <div class="head">
                        <div class="icon"><i class="icosg-star3"></i></div>
                        <h2>信息列表</h2>
                    </div>
                <form action="page/article_delete.action" method="post">
                <div class="block-fluid">
                    <table width="100%" cellspacing="0" cellpadding="0" class="table-hover">
                        <thead>
                            <tr>
                                <th width="3%"><div class="checker"><span><input type="checkbox" class="checkall"></span></div></th>
                                <th width="45%">
                                   	标题
                                </th>
                                <th width="8%">
                                  	 重要
                                </th>
                                <th width="8%">
                                   	显示
                                </th>
                                 <th width="8%">
                                  	 查看
                                </th>
                                 <th width="8%">
                                   	喜欢
                                </th>
                                <th width="14%">
                                 	 操作
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                        	<c:forEach items="${articles }" var="article">
                            <tr>
                                <td>
                                    <div class="checker"><span><input type="checkbox" value="${article.id }" name="ids"></span></div>
                                </td>
                                <td>
                                    <a>${article.title }</a>
                                </td>
                                <td>
                                    ${article.sort }
                                </td>
                                <td>
                                    <c:choose>
                                    	<c:when test="${article.isShow == 1}">
                                    		<span class="label label-success">显示</span>
                                    	</c:when>
                                    	<c:otherwise>
                                    		
                                    		<span class="label label-important">隐藏</span>
                                    	</c:otherwise>
                                    </c:choose>
                                </td>
                                <td>
                                    ${article.viewCount }
                                </td>
                                <td>
                                    ${article.likeCount }
                                </td>
                                <td class="TAC "> 
                                        <a class="tip" data-original-title="编辑"  href="page/article_modify.action?ids=${article.id }">
                                        <span class="icon-edit"></span></a> 
                                        &nbsp;&nbsp;
                                        <a class="tip" data-original-title="删除" onClick="return confirm('您确定要删除【${article.title}】吗？')" href="page/article_delete.action?ids=${article.id }">
                                        <span class="icon-trash"></span></a>
                                    </td>
                            </tr>
                            </c:forEach>
                                 
                        </tbody>
                    </table>
                </div>       
                		<div class="toolbar bottom">
	                        <div class="left" style="width:30%;"> 
	                            <button data-original-title="删除" class="btn btn-small btn-danger tip" title=""><span class="icon-trash icon-white"></span></button>
	                        </div>
	                        <div class="right">
	                       	 	<!-- 引入分页 -->
	                            <jsp:include page="pager_param.jsp"></jsp:include>                   
	                        </div>
                        </div>
                        </form>
                    </div>
                 

            </div>
        </div> 
    </div>  
    
    <!-- 删除成功 -->
    <c:if test="${article_tip == 1}">
    	<script>
    		alert("删除成功 .... ") ; 
    	</script>
    </c:if>
    
     <!-- 修改成功 -->
    <c:if test="${article_tip == 2}">
    	<script>
    		alert("修改成功 .... ") ; 
    	</script>
    </c:if>
    
    <!-- 删除 Session记录 -->
    <%
    	request.getSession().removeAttribute("article_tip") ;
    %>
	
</body>
</html>
